<%@ page import="daoImpl.PostDaoImpl" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Post" %>
<%@ page import="javafx.geometry.Pos" %>
<%@ page import="dao.UserDao" %>
<%@ page import="entity.User" %>
<%@ page import="daoImpl.UserDaoImpl" %>
<%@ page import="dao.PostDao" %><%--
  Created by IntelliJ IDEA.
  User: anzhicheng
  Date: 2017/7/13
  Time: 20:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
</head>
<body>
<%!UserDao dao = new UserDaoImpl(); %>
<% List<User> list = dao.queryFollowToByUserName((String)request.getSession().getAttribute("username")); %>
<%! int pages;%>
<% int maxsize = list.size();
    if (maxsize % 2 == 0){
        pages = maxsize / 2;
    }else {
        pages = maxsize / 2 + 1;
    }
%>
<%
    int targetPage;
    if (request.getParameter("targetPage").matches("[0-9]+")){
        targetPage = Integer.parseInt(request.getParameter("targetPage"));
    }
    else {
        targetPage = 1;
    }
    int begin = 2*(targetPage-1);
%>

<%for (int i = begin;(i<begin + 2)&&(i<maxsize);i++){%>

<div style="text-align: center ;width: 112px;height: 112px; margin-top: 5px;float: left">
    <img src=<%=list.get(i).getHead()%> style="width: 80px;height: 80px;border-radius: 50%"><br>
    <t style="font: 15px 微软雅黑; margin: auto"><%=list.get(i).getUsername()%></t>
</div>
<%}%>
<%
    if (pages!=1){
        for (int i = 0;i<pages;i++){
            int b = i+1;%>
<input type="button"  value=<%=b%> class="centerBtn" onclick="loadMyActPages(this)">
<%}
}
%>


</body>
</html>
